package com.yifi.system.controller;

import com.jfinal.core.Path;
import com.yifi.common.base.BaseController;
import com.yifi.common.utils.StringUtils;

@Path(value="/menu_select")
public class menu_select_controller extends BaseController {

	public void index()
	{
		render("system/menu_select.html");
	}
	
	public void list()
	{
		int pageNum = getParaToInt("pageNum", 1);
		int pageSize = getParaToInt("pageSize", 10);
		
		String name=getPara("name","");
		String sqlSelect="select t1.ccode,t1.cname,t1.cprg,t1.isort,"
				+ "(select cname from work_class2 where ccode=t1.cclass2) as parentname ";
		String sqlExcept=" from work t1 where st_flag='1' ";
		if(StringUtils.isNotEmpty(name))
		{
			sqlExcept+=" and cname like '%"+name+"%'";
		}
		sqlExcept+=" order by cclass2,isort";
		
		renderJson(getDataTable(pageNum, pageSize, sqlSelect, sqlExcept));
	}
}
